home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fritz: All Fritz
/
All Fritz.zip
/
All Fritz
/
FILES
/
PROGNG_C
/
CFUNCTS.LZH
/
PEEK.C
< prev
next >
Wrap
Text File
|
1987-01-22
|
1KB
|
36 lines
/*
===================================================================
P E E K F U N C T I O N
===================================================================
This function will peek a value from a screen memory
location. It is passed the row and column of the
desired location to peek. It will then calculate the
address of the screen location and then return the
value at that address.
-----------------------------------------------------------------*/
char peek(row,col)
int row, col;
{
char far *loc; /* memory location pointer. */
int card_type; /* card type? */
int position; /* cursor position. */
card_type = card();
if(card_type == 1){ /* IBM Color Card. */
loc = (char far *)0xb8000000;
}
else{ /* Monochrome card. */
loc = (char far *)0xb0000000;
}
/* Determine cursor position. */
position = ((row * 80) + col) * 2;
/* Add position to loc. */
loc += position;
return(*loc); /* return value at loc. */
}
/*---------------------------------------------------------------*/